package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gtime"
	"shenmawl/internal/model/entity"
)

//type Response struct {
//	Code    int         `json:"int" dc:"状态码"`
//	Message string      `json:"message" dc:"消息提示"`
//	Data    interface{} `json:"data"    dc:"执行结果"`
//}

type GetOneUserInfoReq struct {
	g.Meta `path:"/system/user/info" method:"post" sm:"获取信息" tags:"用户"`
}

type GetOneUserInfoRes struct {
	Username    string      `json:"username" dc:"用户名"`
	NickName    string      `json:"niclname" dc:"用户昵称"`
	DeptId      int64       `json:"deptid" dc:"部门ID"`
	PhoneNumber string      `json:"phone" dc:"手机号"`
	Email       string      `json:"email" dc:"邮箱"`
	CreatedAt   *gtime.Time `json:"created" dc:"创建时间"`
	LoginAt     *gtime.Time `json:"update" dc:"最后登录时间"`
}

type GetUserListReq struct {
	g.Meta `path:"/system/user/list" method:"post" sm:"获取用户列表" tags:"用户"`
}

type GetUserListRes struct {
	Count int              `json:"count" dc:"列表数量"`
	List  []entity.SysUser `json:"list" dc:"用户列表"`
}

type CreateUserReq struct {
	g.Meta         `path:"/system/user/add" method:"post" sm:"新增用户" tags:"用户"`
	Username       string `json:"username" dc:"账号" v:"required|length:3,12"`
	DeptId         string `json:"dept-id" dc:"部门ID"`
	Nickname       string `json:"nickname" dc:"昵称"`
	Password       string `json:"password" dc:"密码"  v:"required|length:6,16"`
	PasswordRepeat string `json:"passwordrepeat" dc:"重复密码"  v:"required|length:6,16"`
	UserType       string `json:"usertype" dc:"用户类型"`
	Email          string `json:"email" dc:"邮箱"`
	Phone          string `json:"phone" dc:"手机号"`
	Sex            string `json:"sex" dc:"男|女"`
	Avatar         string `json:"avatar" dc:"头像"`
	IP             string `json:"ip" dc:"IP"`
	LoginTime      string `json:"login-time" dc:"最后登录时间"`
	CreateBy       string `json:"create-by" dc:"创建者"`
	CreateTime     string `json:"create-time" dc:"创建时间"`
	UpdateBy       string `json:"update-by" dc:"更新者"`
	UpdateTime     string `json:"update-time" dc:"更新时间"`
	Remark         string `json:"remark" dc:"备注"`
}

type CreateUserRes struct {
}

type UpdateUserReq struct {
	g.Meta `path:"/system/user/edit" method:"post" sm:"修改用户信息" tags:"用户"`
}

type UpdateUserRes struct {
}

type DeleteUserReq struct {
	g.Meta `path:"/system/user/remove" method:"post" sm:"删除用户" tags:"用户"`
}

type DeleteUserRes struct {
}
